﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.UI;

namespace QLNSClient
{
    public partial class Frm_TINHLUONG : DevExpress.XtraEditors.XtraForm
    {
        public Frm_TINHLUONG()
        {
            InitializeComponent();
        }


        DateTime t;
        private void de_LCB_EditValueChanged(object sender, EventArgs e)
        {
            t = de_LCB.DateTime;
            int m = t.Month;
            int y = t.Year;
            de_LCB.Text = m + "/" + y;
        }


        private void btn_XuatLCB_Click(object sender, EventArgs e)
        {
            rpt_LCB rptLCB = new rpt_LCB();
            using (ReportPrintTool printTool = new ReportPrintTool(rptLCB))
            {
                //rptLCB.DataSource = sv.getLCBtheoThangNam(t);

                Parameter Thang = new Parameter();
                Thang.Name = "ChoosedThang";
                Thang.Type = typeof(System.Int32);
                Thang.Value = t.Month;
                rptLCB.Parameters.Add(Thang);
                Thang.Visible = false;
               // rptLCB.FilterString = "[Thang]=?ChoosedThang";

                Parameter Nam = new Parameter();
                Nam.Name = "Choosed";
                Nam.Type = typeof(System.Int32);
                Nam.Value = t.Year;
                rptLCB.Parameters.Add(Nam);
                Nam.Visible = false;
                rptLCB.FilterString = "[Thang]=?ChoosedThang And [Nam]=?Choosed";

                rptLCB.ShowRibbonPreviewDialog();
                
            }
        }


        
    }
}